<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div id="app">
       <cpn :c-info="info"></cpn>
    </div>
    <template id="cpn">
        <!-- 模板必须有一个根元素-->
        <div>
            {{cInfo}}
        </div>
    </template>
    <script src="../js/vue.js"></script>
    <script>
        //父传子 通过props
        const cpn={
            template:'#cpn',
            props:{
                //父子组件
                cInfo:{
                    type:Object,
                    default(){
                        return {}
                    }
                }
            }
        }
          //root 组件
          const app=new Vue({
            el:'#app',
            data:{
               info:{
                    name:'why',
                    age: 23,
                    email:'23232@.com'
               }
            },
            components:{
                cpn
            }
        })
    </script>
</body>
</html>